# 导入包 openpyxl
from openpyxl import load_workbook
from openpyxl.styles.fonts import Font
# 加载Excel 获取工作簿
wb = load_workbook('../data/大一学生考试成绩.xlsx')
# 获取worksheet
ws = wb.active
# 遍历每一行每一列
#设置颜色
font_style = Font(color='00FF0000',size=18,bold=True)
for row in ws.iter_rows(min_row=2,min_col=2):
    for cell in row:
        if cell.value < 60:
            cell.font = font_style


# 判断如果cell中的值<60,标记为红色

# 保存文件
wb.save('标记后的考试成绩.xlsx')
wb.close()